package genericdemo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏西西
 * Date: 2023-10-26
 * Time: 10:34
 */
class MyArray<T>{
    public T[] obj = (T[])new Object[3];

    public Object getPos(int pos){
        return obj[pos];
    }
    public void setObj(int pos,T val){
        obj[pos] = val;
    }
}
public class Test {
    public static void main(String[] args) {
        MyArray<Integer> myArray = new MyArray<>();
        myArray.setObj(0,10);
        myArray.setObj(1,2);

    }
}
